package com.burstly.lib.component.networkcomponent.burstly.html.mraid;

import com.burstly.lib.component.networkcomponent.burstly.OverlayContainer;
import com.burstly.lib.component.networkcomponent.burstly.html.IRichMediaAdListener;
import com.burstly.lib.util.LoggerExt;

class ResizeEvent extends AbstractParseParamsEvent<ResizeProperties>
{
  static final int EVENT_ID = 10;
  private static final LoggerExt LOG = LoggerExt.getInstance();
  private static final String METHOD_NAME = "resize";
  private static final String STATE = "state";
  private static final String TAG = ResizeEvent.class.getSimpleName();
  private MraidView mView;

  protected ResizeEvent()
  {
    super(ResizeProperties.class);
  }

  protected void cleanUp()
  {
    super.cleanUp();
    this.mView = null;
  }

  public void parsed(ResizeProperties paramResizeProperties)
  {
    if (paramResizeProperties != null)
    {
      MraidBridgeState localMraidBridgeState = this.mView.mViewState.getState();
      if (localMraidBridgeState == MraidBridgeState.RESIZED)
      {
        OverlayContainer localOverlayContainer = this.mView.getOpenedOverlay();
        if ((localOverlayContainer != null) && ((localOverlayContainer instanceof MraidResizedView)))
          ((MraidResizedView)localOverlayContainer).reConfigureCreatedContainer(paramResizeProperties);
        this.mView.fireSimpleChangeEvent("state", MraidBridgeState.RESIZED.name().toLowerCase());
        MraidView localMraidView = this.mView;
        Object[] arrayOfObject = new Object[1];
        arrayOfObject[0] = Boolean.TRUE;
        localMraidView.sendEvent(7, arrayOfObject);
      }
      do
      {
        return;
        if (localMraidBridgeState == MraidBridgeState.DEFAULT)
        {
          MraidResizedView localMraidResizedView = new MraidResizedView(this.mView);
          localMraidResizedView.setResizeProperties(paramResizeProperties);
          localMraidResizedView.showOverlayed();
          this.mView.setOpenedOverlay(localMraidResizedView);
          this.mView.fireSimpleChangeEvent("state", MraidBridgeState.RESIZED.name().toLowerCase());
          if (this.mView.mRichMediaListener != null)
            this.mView.mRichMediaListener.onResize();
          this.mView.mViewState.setState(MraidBridgeState.RESIZED);
          return;
        }
      }
      while (localMraidBridgeState != MraidBridgeState.EXPANDED);
      this.mView.fireErrorEvent("resize", "The view is in the expanded state. Resize is forbidden.");
      return;
    }
    this.mView.fireErrorEvent("resize", "Resize properties is not valid JSON string");
  }

  protected boolean setUpEvent(MraidView paramMraidView, Object[] paramArrayOfObject)
  {
    this.mView = paramMraidView;
    if (paramMraidView.mViewState.getState() == MraidBridgeState.EXPANDED)
    {
      paramMraidView.fireErrorEvent("resize", "The view is in the expanded state. Resize is forbidden.");
      return false;
    }
    if (paramMraidView.isInterstitial())
    {
      LOG.logDebug(TAG, "The view is in interstitial mode. Skipped resize call.", new Object[0]);
      return false;
    }
    return true;
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.component.networkcomponent.burstly.html.mraid.ResizeEvent
 * JD-Core Version:    0.6.2
 */